import React, {PureComponent} from 'react';
import {
	StyleSheet,
	Image
} from 'react-native';

/**
 * @FileName: LaunchImage
 * @Author: mazaiting
 * @Date: 2018/6/14
 * @Description:
 */
class LaunchImage extends PureComponent {
	static navigationOptions = {
		// 隐藏底部tab
		tabBarVisible: false,
		// 隐藏顶部导航栏
		header: null
	};
	
	render() {
		return (
			<Image
				source={{uri: 'icon_launcher'}}
				style={styles.launchImageStyle}
			/>
		)
	}
	
	/**
	 * 组件完成挂载
	 */
	componentDidMount() {
		// 定时：隔2s切换到Main
		setTimeout(() => {
			this.props.navigation.replace('Main')
		}, 1000)
	}
}

/**
 * 样式属性
 */
const styles = StyleSheet.create({
	// 启动图样式
	launchImageStyle: {
		flex: 1
	}
});

/**
 * 导出当前Module
 */
module.exports = LaunchImage;